/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xlsBeans;

import com.smartxls.WorkBook;

/**
 *
 * @author Maria de Fatima
 */
public class GeospatialElementsXLS {
    private Double decimalaltitude;
    private Double decimallongitude;
    private Double coordinateuncertainty;
    private String geodeticdatum;
    private String pointradiusspatialfit;
    private String verbatimcoordinates;
    private String verbatimlatitude;
    private String verbatimlongitude;
    private String verbatimcoordinatesystem;
    private String georeferenceprotocol;
    private String verificationstatus;
    private String georeferenceremarks;
    private String footprintwkt;
    private String footprintspatialfit;

    private int sp;

    public GeospatialElementsXLS() {
         this.decimalaltitude = null;
        this.decimallongitude = null;
        this.coordinateuncertainty = null;
        this.geodeticdatum = "";
        this.pointradiusspatialfit = "";
        this.verbatimcoordinates = "";
        this.verbatimlatitude = "";
        this.verbatimlongitude = "";
        this.verbatimcoordinatesystem = "";
        this.georeferenceprotocol = "";
        this.verificationstatus = "";
        this.georeferenceremarks = "";
        this.footprintwkt = "";
        this.footprintspatialfit = "";
    }

    public GeospatialElementsXLS(WorkBook w, int l, int sp) {
        try{
            setGeospatialElements(w, l, sp);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    public void setGeospatialElements(WorkBook w, int l, int sp) throws Exception {
        try{
            if(!w.getText(l, 69 + sp).trim().equals(""))
                this.decimalaltitude = Double.parseDouble(w.getText(l, 69 + sp).replaceAll(",", "."));
            else this.decimalaltitude = null;
        }catch(NumberFormatException e){
            this.decimalaltitude = null;
        }
        try{
            if(!w.getText(l, 70 + sp).trim().equals(""))
                this.decimallongitude = Double.parseDouble(w.getText(l, 70 + sp).replaceAll(",", "."));
            else this.decimallongitude = null;
        }catch(NumberFormatException e){
            this.decimallongitude = null;
        }
        try{
            if(!w.getText(l, 96 + sp).trim().equals(""))
                this.coordinateuncertainty = Double.parseDouble(w.getText(l, 96 + sp).replaceAll(",", "."));
            else this.coordinateuncertainty = null;
        }catch(NumberFormatException e){
            this.coordinateuncertainty = null;
        }
        this.geodeticdatum = w.getText(l, 97 + sp);
        this.pointradiusspatialfit = w.getText(l, 98 + sp);
        this.verbatimcoordinates = w.getText(l, 99 + sp);
        this.verbatimlatitude = w.getText(l, 100 + sp);
        this.verbatimlongitude = w.getText(l, 101 + sp);
        this.verbatimcoordinatesystem = w.getText(l, 102 + sp);
        this.georeferenceprotocol = w.getText(l, 103 + sp);
        this.verificationstatus = w.getText(l, 104 + sp);
        this.georeferenceremarks = w.getText(l, 105 + sp);
        this.footprintwkt = w.getText(l, 106 + sp);
        this.footprintspatialfit = w.getText(l, 107 + sp);

    }

        public boolean isSetGeo(){
        if(this.decimalaltitude == null && this.decimallongitude == null && this.coordinateuncertainty == null && this.geodeticdatum.equals("") && this.pointradiusspatialfit.equals("") && this.verbatimcoordinates.equals("") && this.verbatimlatitude.equals("") && this.verbatimlongitude.equals("") && this.verbatimcoordinatesystem.equals("") && this.georeferenceprotocol.equals("") && this.verificationstatus.equals("") && this.georeferenceremarks.equals("") && this.footprintwkt.equals("") && this.footprintspatialfit.equals(""))
            return  false;
        else return true;
    }

    public Double getDecimalaltitude() {
        return decimalaltitude;
    }

    public void setDecimalaltitude(Double decimalaltitude) {
        this.decimalaltitude = decimalaltitude;
    }

    public Double getDecimallongitude() {
        return decimallongitude;
    }

    public void setDecimallongitude(Double decimallongitude) {
        this.decimallongitude = decimallongitude;
    }

    public Double getCoordinateuncertainty() {
        return coordinateuncertainty;
    }

    public void setCoordinateuncertainty(Double coordinateuncertainty) {
        this.coordinateuncertainty = coordinateuncertainty;
    }

    public String getFootprintspatialfit() {
        return footprintspatialfit;
    }

    public void setFootprintspatialfit(String footprintspatialfit) {
        this.footprintspatialfit = footprintspatialfit;
    }

    public String getFootprintwkt() {
        return footprintwkt;
    }

    public void setFootprintwkt(String footprintwkt) {
        this.footprintwkt = footprintwkt;
    }

    public String getGeodeticdatum() {
        return geodeticdatum;
    }

    public void setGeodeticdatum(String geodeticdatum) {
        this.geodeticdatum = geodeticdatum;
    }

    public String getGeoreferenceprotocol() {
        return georeferenceprotocol;
    }

    public void setGeoreferenceprotocol(String georeferenceprotocol) {
        this.georeferenceprotocol = georeferenceprotocol;
    }

    public String getGeoreferenceremarks() {
        return georeferenceremarks;
    }

    public void setGeoreferenceremarks(String georeferenceremarks) {
        this.georeferenceremarks = georeferenceremarks;
    }

    public String getPointradiusspatialfit() {
        return pointradiusspatialfit;
    }

    public void setPointradiusspatialfit(String pointradiusspatialfit) {
        this.pointradiusspatialfit = pointradiusspatialfit;
    }

    public int getSp() {
        return sp;
    }

    public void setSp(int sp) {
        this.sp = sp;
    }

    public String getVerbatimcoordinates() {
        return verbatimcoordinates;
    }

    public void setVerbatimcoordinates(String verbatimcoordinates) {
        this.verbatimcoordinates = verbatimcoordinates;
    }

    public String getVerbatimcoordinatesystem() {
        return verbatimcoordinatesystem;
    }

    public void setVerbatimcoordinatesystem(String verbatimcoordinatesystem) {
        this.verbatimcoordinatesystem = verbatimcoordinatesystem;
    }

    public String getVerbatimlatitude() {
        return verbatimlatitude;
    }

    public void setVerbatimlatitude(String verbatimlatitude) {
        this.verbatimlatitude = verbatimlatitude;
    }

    public String getVerbatimlongitude() {
        return verbatimlongitude;
    }

    public void setVerbatimlongitude(String verbatimlongitude) {
        this.verbatimlongitude = verbatimlongitude;
    }

    public String getVerificationstatus() {
        return verificationstatus;
    }

    public void setVerificationstatus(String verificationstatus) {
        this.verificationstatus = verificationstatus;
    }

    
}
